<?php

class Antz_Form_Components_Radio extends Antz_Form_Component
{

    public function __construct()
    {

    }

    public function render($selectedVal=''){
    	global $gCms;
     	$Antz = Antz::registry('Antz');
     	if($this->required) $required = '<span class="required"><img src="'.$gCms->config['root_url'].'/modules/Antz/images/required.gif" alt="'.$Antz->Lang('required').'" /></span>'.$this->aftertext;
    	else $required = '';
        $returnString = $required;
        $returnString .= '<label for="'.$this->getId().'"><input type="radio" name="'.$this->name.'" id="'.$this->getId().'" value="'.$this->value.'" '.$this->renderParameters();
        $returnString .= ($this->value==$selectedVal) ? ' checked="checked" ' : '';
        $returnString .= '>'.$this->label.'</label>';
        return $returnString;
    }

}
